const routes = [{
        name: 'home',
        path: '/home',
        component: () => import('@/pages/Home'),
        meta: {
            isShowNav: true
        }
    },
    {
        name: 'login',
        path: '/login',
        component: () => import('@/pages/Login'),
        meta: {
            // 是否隐藏底部
            isHiddenFooter: true
        }
    },
    {
        name: 'register',
        path: '/register',
        component: () => import('@/pages/Register'),
        meta: {
            isHiddenFooter: true
        }
    },
    {
        name: 'search',
        // params 参数需要一个占位
        path: '/search/:keyword?', // 类似于正则中的? 表示0个或1个
        component: () => import('@/pages/Search'),
    },
    {
        name: 'detail',
        path: '/detail/:id',
        // component: Detail,
        component: () => import('@/pages/Detail'),
        props: true // 在组件内就可以使用props的方式来获取对应的params参数
    },
    {
        name: 'addCartSuccess',
        path: '/addCartSuccess',
        // component: AddCartSuccess
        component: () => import('@/pages/AddCartSuccess'),
    },
    {
        name: 'shopCart',
        path: '/shopCart',
        // component: ShopCart
        component: () => import('@/pages/ShopCart'),
    },
    {
        // 结算中心 在这个里面有收货的地址和购买的商品
        name: 'trade',
        path: '/trade',
        // component: Trade
        component: () => import('@/pages/Trade'),
    },
    {
        // 付款界面 支付媒介
        name: 'pay',
        path: '/pay',
        // component: Pay
        component: () => import('@/pages/Pay'),
    },
    {
        // 支持成功的界面
        name: 'paysuccess',
        path: '/paySuccess',
        // component: PaySuccess
        component: () => import('@/pages/PaySuccess'),
    },
    {
        // 最后支付完成之后查看的之前的购物清单
        name: 'center',
        path: '/center',
        // component: Center
        component: () => import('@/pages/Center'),
    },
    {
        path: '/',
        redirect: '/home'
    }
];

export default routes;